from django.db import models
from django.contrib import auth
    
class Book(models.Model):    
    def __unicode__(self):
        return self.title
    uuid = models.CharField(max_length=100, primary_key=True)
    title = models.CharField(max_length=100)
    isbn_13 = models.IntegerField()
    description = models.CharField(max_length=1000)
    image_url = models.CharField(max_length=200)
    
class Price(models.Model):
    book = models.ForeignKey(Book)
    price = models.FloatField()
    purchase_url = models.CharField(max_length=200)
    condition = models.CharField(max_length=20)
    vendor = models.CharField(max_length=100)
    
    class Meta:
        ordering = ["price"]

class Author(models.Model):
    book = models.ForeignKey(Book)
    author = models.CharField(max_length=100)
